d06f3af04febed9ccd113ed3f2febf3e031d89b2,core/src/androidTest/java/org/hisp/dhis/android/core/program/ProgramStageSectionStoreIntegrationTest.java,ProgramStageSectionStoreIntegrationTest,delete_shouldDeleteProgramStageSectionWhenDeletingProgramStage,#,97
Before Change
String[] projection = {Columns.ID, Columns.UID, Columns.PROGRAM_STAGE};
Cursor cursor = database().query(Tables.PROGRAM_STAGE_SECTION, projection, null, null, null, null, null);
// checking that program stage section was successfully inserted
assertThatCursor(cursor).hasRow(ID, UID, PROGRAM_STAGE);
// deleting foreign key reference
database().delete(Tables.PROGRAM_STAGE, ProgramStageModel.Columns.UID + "=?", new String[]{PROGRAM_STAGE});
After Change
String[] projection = {Columns.ID, Columns.UID, Columns.PROGRAM_STAGE};
Cursor cursor = database().query(Tables.PROGRAM_STAGE_SECTION, projection, null, null, null, null, null);
// checking that program stage section was successfully inserted
assertThatCursor(cursor).hasRow(ID, UID, PROGRAM_STAGE).isExhausted();
// deleting foreign key reference
database().delete(Tables.PROGRAM_STAGE, ProgramStageModel.Columns.UID + "=?", new String[]{PROGRAM_STAGE});